<template>
	<cu-page-base :nav-bar-options="navBarOptions" @clickNavBarLeft="goBack">
		<view class="cu-px-20 cu-pt-50 cu-w-100 cu-d-flex cu-j-center cu-a-center cu-flex-column">
			<block v-if="idx !== undefined">
				<uni-section class="cu-w-100" :title="problemStore.list[idx].title" type="line">
					<view class="cu-w-100 cu-px-20 cu-d-flex cu-flex-column cu-a-stretch cu-j-sb">
						<block v-for="(item,index) in problemStore.list[idx].ans">
							<view :key="index" style="line-height: 40rpx;"><text class="cu-w-100 cu-px-20"></text>{{item}}</view>
						</block>
					</view>
				</uni-section>
				
			</block>
		</view>
	</cu-page-base>

</template>

<script>
	import {
		mapState
	} from 'vuex';
	import commMiXin from '@/common/mixin/common-mixin.js';
	export default {
		mixins: [commMiXin],
		computed: {
			...mapState({
				commonStore: state => state.commonStore,
				problemStore:state => state.problemStore,
			})
		},
		data() {
			return {
				navBarOptions: {
					title: "常见问题详情",
					leftText: "返回",
					leftIcon: "back",
				},
				idx:undefined
			};
		},
		onLoad(e) {
			console.log(e)
			const {idx} = e
			if(idx !== undefined){
				this.idx = idx
			}
		},
		methods: {
			goBack(data) {
				this.gotoPage(1,'navigateBack');
			},
		}
	}
</script>

<style lang="scss">
.uni-section-content{
	padding: 10px;
}

</style>